Routines (alphabetical) > Routines: H > HDF Routines > HDF_DFAN_GETDESC

HDF_DFAN_GETDESC

The HDF_DFAN_GETDESC procedure reads the description for the given tag and reference number in an HDF file.

Syntax

HDF_DFAN_GETDESC, Filename, Tag, Ref, Description [, /STRING]

Arguments

Filename

A scalar string containing the name of the file to be read.

Tag

The tag number.

Reference

The reference number.

Description

A named variable in which the description is returned as a vector of bytes.

If a description does not exist, the Description variable will contain either a 0L (long-integer zero) or a blank string, and a warning message will be printed. Warning messages can be suppressed by setting the !QUIET system variable to a non-zero value.

Keywords

STRING

Set this keyword to return the description as a string rather than a vector of bytes.

Examples

desc1 = 'FILE DESCRIPTION NUMBER 1'

tag_image = 302

file = 'DEMOdesc.hdf'

fid = HDF_OPEN(file, /CREATE)

HDF_DFR8_ADDIMAGE, file, DIST(10)

HDF_DFAN_PUTDESC, file, tag_image, HDF_DFR8_LASTREF(), desc1

; Read the description and return a vector of bytes:

HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), out_desc1

HELP, out_desc1

PRINT, STRING(out_desc1)

; Read the description and return an IDL string variable:

HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), $

    out_desc2, /STRING

HELP, out_desc2

HDF_CLOSE, fid

IDL Output

OUT_DESC1 BYTE = Array(25)

 

FILE DESCRIPTION NUMBER 1

 

OUT_DESC2 STRING = 'FILE DESCRIPTION NUMBER 1'

Version History

 

4.0

Introduced

See Also

HDF_DFAN_PUTDESC